﻿{extend name="$_tpl_public_layout_danceadmin"/}


{block name="breadcrumb"}
<ol class="breadcrumb">
	<li class="breadcrumb-item"><a href="{:url('admin/index/index')}">{:config('system.site_title')}</a></li>
	<li class="breadcrumb-item"><a href="{:url('mobmall_manage/user/index')}">{$sideName}</a></li>
</ol>
{/block}


{block name="pageheader"}
{$sideName}
{/block}


{block name="content"}
<div class="card">
	<div class="card-body">
		<form method="post" action="{:url('mobmall_manage/user/doSetAdmin')}" class="form-horizontal J_ajaxForm">
			<input type="hidden" name="id" value="{$id}" />
			<div class="form-group row">
				<label class="col-sm-2 control-label">选择管理员</label>
				<div class="col-sm-6">
					<select id="mySelect" name="admin_uid" class="form-control js-data-example-ajax">
						<option value="{$info['admin_uid']}">{$info['admin_username']}</option>
					</select>
				</div>
				<div class="col-sm-4"></div>
			</div>
			<div class="clearfix form-actions">
				<div class="offset-md-2 col-sm-10">
					<button class="btn btn-primary btn-sm J_ajaxSubmit">保存修改</button>
				</div>
			</div>
		</form>
	</div>
</div>
{/block}


{block name="script"}
<!-- select2 -->
<link rel="stylesheet" type="text/css" href="/static/dancewidgets/select2/select2.min.css">
<script type="text/javascript" src="/static/dancewidgets/select2/select2.min.js"></script>
<style type="text/css">
.select2-container .select2-selection--single{height:34px;}
</style>
<script type="text/javascript">
var url = "{:url('admin/adminUser/ajaxAssociate')}";
$('#mySelect').select2({
	ajax: {
		url: url,
		data: function (params){
			var query = {
				word: params.term,
			}
			// Query parameters will be ?search=[term]&type=public
			return query;
		},
		processResults: function (ret){
			console.log(ret);
			if(ret.code == 1){
				var data = ret.data;
				return {
					results: data.list
				};
			}else if(ret.code == 0){
				Wei.Util.wapTipNew({msg: ret.msg, icon: 2, time: ret.time,});
			}
		}
	}
});
</script>
{/block}